/**
 * @product: PCDC-CMS
 * @copyright: FSAI-南征北战信息科技
 * @filename: com.fsai.cms.CmsWebApplication.java
 *
 * @link: Http://www.fastsai.com
 * @jdkv: Jdk 1.8
 */
package com.fsai.cms;

import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.core.env.Environment;

/**
 *
 * @project: pcdc-cms-web
 *
 * @author: JaffeHe
 * @email: JaffeHe@foxmail.com
 * @date: 2021-03-13 10:56
 *
 * @ChangeLog<br/>
 * 				Developer Date Comment <br/>
 */
@SpringBootApplication
@EnableAutoConfiguration
@MapperScan("com.fsai.cms.mapper")
public class CmsWebApplication {
	private static Logger log = LoggerFactory.getLogger(CmsWebApplication.class);

	public static void main(String[] args) throws Exception {
		long start = System.currentTimeMillis();
		ApplicationContext context = SpringApplication.run(CmsWebApplication.class, args);

		Environment env = context.getEnvironment();
		log.info("====================================================================");
		log.info("项目版本: {}", env.getProperty("project.version"));
		log.info("启动环境: {}", env.getProperty("spring.profiles.active"));
		log.info("启动端口: {}", env.getProperty("server.port"));
		log.info("日志等级: {}", env.getProperty("logback.level"));
		log.info("Swagger: {}", Boolean.valueOf(env.getProperty("swagger.enabled")) ? "启用" : "禁用");

		log.info("Startup complete ...");
		long alltime = (System.currentTimeMillis() - start) / 1000;
		log.info("============================耗时：(" + alltime + "秒)========================================");

	}
}
